using System;
using System.Collections.Generic;

namespace WHSMailCommon.Entities
{
	// entity object representing an Folder
	[Serializable]
	public class Folder : IComparable
	{
		private string _entryID;
		private string _name;
		private List<Folder> _folders;
		private int _unreadMessages;
		private int _totalMessages;

		public Folder(string entryID, string name, int unreadMessages, int totalMessages)
		{
			_entryID = entryID;
			_name = name;
			_unreadMessages = unreadMessages;
			_totalMessages = totalMessages;
		}

		// MAPI unique identifier
		public string EntryID
		{
			get { return _entryID; }
			set { _entryID = value; }
		}

		// subfolders of this folder
		public List<Folder> Folders
		{
			get { return _folders; }
			set { _folders = value; }
		}

		public string Name
		{
			get { return _name; }
			set { _name = value; }
		}

		public int UnreadMessages
		{
			get { return this._unreadMessages; }
			set { this._unreadMessages = value; }
		}

		public int TotalMessages
		{
			get { return this._totalMessages; }
			set { this._totalMessages = value; }
		}

		// used so we can sort the folders alphabetically later on
		public int CompareTo(object obj)
		{
			return string.Compare(this.Name, ((Folder)obj).Name);
		}
	}
}
